package com.zmn.plat.persistence.interfaces.channel;

import com.zmn.plat.model.entity.channel.ChannelDeposit;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 渠道押金
 *
 * @author xiangjunming
 * @since 2019 /08/19 12:14:58
 */
public interface ChannelDepositDAO {

    /**
     * 根据ID查询
     *
     * @param channelId the id
     * @return the channel new deposit
     */
    ChannelDeposit findByKey(Integer channelId);

    /**
     * 根据渠道ID批量查询
     *
     * @param channelIds the channel ids
     * @return the list
     */
    List<ChannelDeposit> listByChannelIds(@Param("channelIds") List<Integer> channelIds);

    /**
     * 增加渠道押金余额
     *
     * @param channelId 渠道ID
     * @param amount    金额
     * @return the int
     */
    int addBalance(@Param("channelId") Integer channelId, @Param("amount") Integer amount);

    /**
     * 根据ID修改
     *
     * @param record the record
     * @return the int
     */
    int updateByKey(ChannelDeposit record);

    /**
     * 新增
     *
     * @param record the record
     * @return the int
     */
    int insert(ChannelDeposit record);

    /**
     * 删除
     *
     * @param channelId the id
     * @return the int
     */
    int deleteByKey(Integer channelId);

    /**
     * 描述: 从旧渠道复制到新渠道
     *
     * @param originalChannelId 原渠道ID
     * @param targetChannelId 新渠道ID
     * @param operator 操作者
     * @return java.lang.Boolean
     * @author guoqiao
     * @since 2021/6/8 13:49
     */
    void copy(Integer originalChannelId, int targetChannelId, String operator);
}